<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true"
    android:gravity="center"
    android:orientation="vertical">

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/bigProgressBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/big_progress_bar_margin"
        android:layout_marginEnd="@dimen/big_progress_bar_margin"
        android:indeterminate="true"
        android:visibility="visible"
        app:trackCornerRadius="@dimen/loading_corner_radius"
        tools:visibility="gone" />

    <androidx.core.widget.NestedScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        android:visibility="gone"
        tools:visibility="visible">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:animateLayoutChanges="true">

            <androidx.constraintlayout.widget.Group
                android:id="@+id/subject_content"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:constraint_referenced_ids="subject_name,period_name,rating_card,marks_container"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/subject_name"
                android:layout_width="wrap_content"
                android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
                android:layout_margin="16dp"
                android:gravity="bottom"
                android:textAppearance="?attr/textAppearanceHeadlineMedium"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:text="@string/placeholder_lesson_name" />

            <TextView
                android:id="@+id/period_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="16dp"
                android:textAppearance="@style/TextAppearance.Material3.ActionBar.Subtitle"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/subject_name"
                tools:text="3 trimester" />

            <com.google.android.material.card.MaterialCardView
                android:id="@+id/rating_card"
                style="@style/Widget.Material3.CardView.Filled"
                android:layout_width="match_parent"
                android:layout_height="@dimen/rating_card_height"
                android:layout_margin="@dimen/rating_card_margin"
                android:clickable="true"
                android:focusable="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/period_name">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/rating_status"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/rating_card_margin"
                        android:text="@string/placeholder_rating"
                        android:textSize="@dimen/rating_place_text_size"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/rating_button"
                        style="@style/Widget.Material3.Button.IconButton"
                        android:layout_width="wrap_content"
                        android:layout_height="@dimen/goto_rating_layout_height"
                        android:layout_marginEnd="@dimen/goto_rating_margin_end"
                        android:contentDescription="@string/content_show_rating"
                        android:insetLeft="0dp"
                        android:insetTop="0dp"
                        android:insetRight="0dp"
                        android:insetBottom="0dp"
                        app:icon="@drawable/ic_round_filter_list_24"
                        app:iconPadding="0dp"
                        app:iconSize="@dimen/goto_rating_size"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toTopOf="parent">

                    </com.google.android.material.button.MaterialButton>

                </androidx.constraintlayout.widget.ConstraintLayout>

            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:id="@+id/avgCard"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/mark_rating_margin"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/rating_card">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/mark_rating_padding">

                    <TextView
                        android:id="@+id/avg"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="sans-serif"
                        android:text="@string/placeholder_main_rating_average"
                        android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
                        app:layout_constraintBottom_toTopOf="@+id/avgDesc"
                        app:layout_constraintEnd_toStartOf="@+id/avgImportant"
                        app:layout_constraintStart_toStartOf="parent" />

                    <TextView
                        android:id="@+id/avgImportant"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/placeholder_main_rating_average"
                        android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
                        app:layout_constraintBottom_toTopOf="@+id/avgImportantDesc"
                        app:layout_constraintEnd_toStartOf="@+id/weightedAvg"
                        app:layout_constraintStart_toEndOf="@+id/avg" />

                    <TextView
                        android:id="@+id/weightedAvg"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/placeholder_main_rating_average"
                        android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
                        app:layout_constraintBottom_toTopOf="@+id/weightedAvgDesc"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/avgImportant" />

                    <TextView
                        android:id="@+id/avgDesc"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/average_mark"
                        android:textAppearance="@style/TextAppearance.Material3.LabelSmall"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="@+id/avg"
                        app:layout_constraintStart_toStartOf="@+id/avg" />

                    <TextView
                        android:id="@+id/avgImportantDesc"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/average_important"
                        android:textAppearance="@style/TextAppearance.Material3.LabelSmall"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="@+id/avgImportant"
                        app:layout_constraintStart_toStartOf="@+id/avgImportant" />

                    <TextView
                        android:id="@+id/weightedAvgDesc"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/weighted_average"
                        android:textAppearance="@style/TextAppearance.Material3.LabelSmall"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="@+id/weightedAvg"
                        app:layout_constraintStart_toStartOf="@+id/weightedAvg" />
                </androidx.constraintlayout.widget.ConstraintLayout>
            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:id="@+id/marks_container"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_margin="16dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/avgCard">

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/marksRecyclerView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </com.google.android.material.card.MaterialCardView>

        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>


</LinearLayout>